package com.dacel.ergraph.web.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;

import com.dacel.ergraph.model.Category;

public class WelcomeController extends AbstractController {

    private static final Log LOG = LogFactory.getLog(WelcomeController.class);

    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

    	LOG.info("Returning hello view");

        List<Category> lstCategories = getCategoryManager().getAll();
        
        LOG.info("List category : " + lstCategories.size());
        
        return new ModelAndView("/jsp/welcome.jsp");
    }

}
